//
//  ViewController.swift
//  FZSFTakePhotoDemo
//
//  Created by 李雷川 on 2018/4/25.
//  Copyright © 2018年 李雷川. All rights reserved.
//

import UIKit
import FZSFTakePhoto
import FZSFCommonTools
class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.

        let button = UIButton.custom(title: "点击拍照", titleColor: AppColors.highlight, borderColor: AppColors.highlight, radius: 4)
        button.addTarget(self, action: #selector(takePhoto(sender:)), for: .touchUpInside)
        view.addSubview(button)
        button.frame = CGRect.init(x: 100, y: 100, width: 100, height: 32)
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


    
    @objc func takePhoto(sender:UIButton){
        let takePhotoViewController =  FZCameraViewController()
//        takePhotoViewController.isCanSwitchCamera = false
        let navigationViewController = FZNavigationController(rootViewController: takePhotoViewController)
        self.present(navigationViewController, animated: true, completion: nil)
//        takePhotoViewController.startEvaluateClosure = {
//            [unowned self](image,viewController,faildClosure) in
//            viewController.dismiss(animated: true, completion: nil)
//        }
    }
}

